package com.zhangzy.qm.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import com.zhangzy.qm.entity.Ablum;
import com.zhangzy.qm.entity.Ranking;

public class RankingDao extends BaseDao<Ranking> { 

	public List<Ranking> query(String hql){
		return super.getHibernateTemplate().find(hql);
	}
	public List<Ranking> query(String sql,int start,int pageSize){
		Session session = getSession();
		Query query = session.createQuery(sql);
		query.setFirstResult(start);
		query.setMaxResults(pageSize);		
		List<Ranking> list = query.list();
		session.close();	
		return list;
	}
}
